import * as actionTypes from './constants';
import { getSearchResult } from '@/services/search';

const changeSearchResultAction = ({result}) => ({
  type: actionTypes.CHANGE_SEARCH_RESULT,
  result
})


export const getSearchListAction = (props) => {
  return dispatch => {
    getSearchResult(props).then(res => {
      dispatch(changeSearchResultAction(res))
      console.log(res);
    })
  }
}
